<li class="rev-item comment-item clearfix">
    <div class="user"><a class="avatar" href="#" target="_blank"><img
            src="${c.headUrl}"
            width="48" height="48"></a><span class="level">LV.${c.level}</span></div>
    <a class="useful" data-id="191407415" title="点赞">
        <i></i><span class="useful-num">0</span>
    </a>
    <a class="name" href="#" target="_blank">${c.username}</a>
    <span class="s-star s-star${c.rank}"></span>
    <p class="rev-txt">
    ${c.content}
    </p>

    <div class="info clearfix">
        <a class="btn-comment _j_comment" id="${c._id}" title="添加评论">评论</a>
        <span class="time">${c.createTime?string('yyyy-MM-dd HH:mm:ss')}</span>
    </div>
    <div class="comment add-reply ">
        <ul class="more_reply_box comment_list" id="ul${c._id}">
        </ul>
    </div>
    <div class="add-comment hide reply-form" data-area="${c._id}" style="display: none;"
         data-show="false">
                        <textarea class="comment_reply " autofocus data-comment_id="${c._id}"
                                  data-ScenicId="${c.scenicId}"
                                  style="overflow: hidden; color: rgb(204, 204, 204);"
                                  placeholder="发表评论:"></textarea>
        <a class="btn btn_submit_reply}" id="reply${c._id}">回复</a>
    </div>
</li>
<script>
    //对点评发表评论
    $('#reply${c._id}').click(function () {
        var content = $('textarea[data-comment_id=${c._id}]').val();
        if(!content){
            alert("评论不能为空!");
            return;
        }
        $.post('/scenic/refCommentAdd',{scenicId:'${c.scenicId}',content:content,type:1,'refCommentId':'${c._id}','refComment.username':'${c.username}'},function (data) {
            $('#ul${c._id}').append(data);
        })
        if(!$('.add-reply').hasClass("comment")){
            $('.add-reply').addClass("comment");
        }
        $('.add-comment').attr('style', 'display: none;')
        $('textarea[data-comment_id=${c._id}]').val('');
        flag = false;
    })


    var flag = false;
    $('#${c._id}').click(function () {
        if (!flag) {
            $('div[data-area=${c._id}]').attr('style', 'display: block;')
            $('textarea[data-comment_id=${c._id}]').focus()
            $('textarea[data-comment_id=${c._id}]').addClass('focus')
            flag = true;
        } else if(flag) {
            $('.add-comment').attr('style', 'display: none;')
            flag = false;
        }
    })
</script>